<?php
error_reporting(E_ALL | E_NOTICE);
if (isset($_GET['xdebug']) && $_GET['xdebug'] > 0){
    ini_set("profiler_output_dir","./");
    ini_set("profiler_output_name","cachegrind.out.%p");
    ini_set("xdebug.profiler_enable",1);
}

require_once ROOT_PATH."core/IMGlobal.php";
require_once ROOT_PATH."core/config.php";
require_once ROOT_PATH."core/ImageLib.php";
require_once ROOT_PATH."core/EnBacImage.php";

global $thumb_size, $thumb_in_size, $thumb_w_size, $thumb_wl_size;
//Kích thước ảnh có chiều rộng x chiều dài 
IMGlobal::$thumb_size 		= $thumb_size;
IMGlobal::$thumb_in_size 	= $thumb_in_size;
IMGlobal::$thumb_w_size 		= $thumb_w_size;
IMGlobal::$thumb_wl_size 	= $thumb_wl_size;

IMGlobal::$img_servers 		= $img_servers;

$host_arr = split("\.",$_SERVER['HTTP_HOST']);

if(count($host_arr) == 3){
	$s_img = $host_arr[0];
}

if(isset($s_img) && isset(IMGlobal::$img_servers[$s_img])){
	EnBacImage::$path = IMGlobal::$img_servers[$s_img];
}
else{
	EnBacImage::$path = current(IMGlobal::$img_servers);
}

unset($thumb_size,$thumb_w_size,$thumb_wl_size,$thumb_max_size,$img_servers,$host_arr,$s_img);
?>
